package study.dq.unit.test.until;

import java.sql.Connection;
import java.sql.SQLException;

public class DBUtil {


    public static Connection getConnection(){
//        Connection conn = null;
//        try {
//            Class.forName("org.h2.Driver");
//            conn = DriverManager.getConnection("jdbc:h2:~/test", "sa", "");
//        } catch (ClassNotFoundException e) {
//            e.printStackTrace();
//        } catch (SQLException e) {
//            e.printStackTrace();
//        }
       return DruidConnection.getInstance().getConnect();
//        return conn;
    }

    public static void closeConnection(Connection connection){
        try {
            connection.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
